import socket

# 买手机
# SOCK_STREAM流式协议=》tcp协议
# SOCK_DGRAM报式协议=》udp协议
phone = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

# 建立电话连接conn
phone.connect(('127.0.0.1', 8080))
phone.send('hello 哈哈哈 123456'.encode('utf-8'))
data=phone.recv(1024)
print("服务端回复：",data.decode('utf-8'))
print(phone)
phone.close()
